package com.zretc.controller;

import com.zretc.service.ChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by Administrator on 2020/8/27.
 */
@Controller
public class ChatController {
    @Autowired
    private ChatService chatService;
    @RequestMapping("/list")
    @CrossOrigin(origins = "http://127.0.0.1:8080", maxAge = 3600)
    @ResponseBody
    public List<String> findUserByCondition(@RequestParam String userId){
        if(userId.equals("all")){
            userId="";
        }
        return chatService.findUserByCondition(userId);
    }
}
